CC = gcc

all: app server

app: app.o
	$(CC) -o app app.o barrierclient.o restart.o makeargv.o

server: barrierserver.o
	$(CC) -o server barrierserver.o

app.o: app.c 
	$(CC) -c app.c

barrierserver.o: barrierserver.c restart.h
	$(CC) -c barrierserver.c restart.h

barrierclient.o: barrierclient.c restart.h
	$(CC) -c barrierclient.c restart.h

restart.o: restart.c restart.h
	$(CC) -c restart.c

makeargv.o: makeargv.c
	$(CC) -c makeargv.c

clean:
	@-rm *.o app server *.request *.release
	@-rm *.ps *.pdf

barrierserver.ps:
	a2ps -o barrierserver.ps barrierserver.c
barrierclient.ps:
	a2ps -o barrierclient.ps barrierclient.c
app.ps:
	a2ps -o app.ps app.c

pdf: barrierserver.ps barrierclient.ps app.ps
	ps2pdf barrierserver.ps
	ps2pdf barrierclient.ps
	ps2pdf app.ps
